<template>
  <div id="app">
    <img src="./assets/tom.jpg">
    <a-button type="primary" plain size="mini" @click="goHome(123)">
      vuex
    </a-button>

    <el-button type="success" plain size="mini" @click="toMap">跳转地图</el-button>


    <el-button type="primary" icon="el-icon-edit" circle style="margin-right: 20px" @click="goChart"></el-button>

    <router-link to='/home'>
      <el-button type="success" plain size="mini">跳转页面</el-button>
    </router-link>
    <router-view/>
  </div>
</template>

<script>
export default {
  name: 'App',
  methods: {

    toMap() {
      this.$router.push({
        path: '/baseMap',

      })
    },


    goChart(){

      this.$router.push({name: 'MyChart'})
    },

    goHome(id) {
      // this.$router.push({
      //   path: '/home',
      //   query: {
      //     id: id
      //   }
      // })
      //this.$router.push({path:'/home'})


      /* query类似 get, 跳转之后页面 url后面会拼接参数,类似?id=1, 非重要性的可以这样传, 密码之类还是用params刷新页面id还在

         params类似 post, 跳转之后页面 url后面不会拼接参数 , 但是刷新页面id 会消失*/

      this.$router.push({name: 'Home', params: {id: '1'}})



    },
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
